<div class="data-div" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="widget-header bordered-bottom bordered-themeprimary">
        <i class="widget-icon fa fa-tasks themeprimary"></i>
        <span class="widget-caption themeprimary">数据列表</span>
        <form  role="form" onsubmit="return false;" id="form_data_table_commission_log_cur_user_list_1">
            <input  type="hidden" value="1" name="logType"/>
            <input  type="hidden" name="uid" th:value="${uid}"/>
            <div class="widget-buttons">
                支付状态：<select name="payStatus" id="payStatus"  style="width:160px;margin-right:10px;padding: 3px;" >
                            <option value="">--全部--</option>
                            <option value="0">--未支付--</option>
                            <option value="1">--已支付--</option>
                         </select>
                层级：<select name="gradeType" id="gradeType"  style="width:160px;margin-right:10px;padding: 3px;" >
                            <option value="">--全部--</option>
                            <option value="1">--直推--</option>
                            <option value="2">--间推--</option>
                         </select>
                付款用户（电话）：<input type="text" name="sourceUserName" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
                付款用户昵称：<input type="text" name="sourceNickName" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
            </div>
            <div class="widget-buttons">
                <button href="javascript:;" class="btn btn-blue btn-xs search"  data-title="查询" data-form="true" onclick="">查询</button>
            </div>

        </form>
    </div>

    <div class="widget no-header ">
        <div class="widget-body">
            <div id="js-total-space" style="display: none;padding: 12px 8px;height: 40px;font-size: 14px;color: red;"></div>
            <table class="table table-condensed table-bordered table-hover " id="data_table_commission_log_cur_user_list_1">
            </table>

        </div>
    </div>
    <!-- END SAMPLE TABLE PORTLET-->
</div>

<script type="text/javascript">

    $(document).ready(function() {

        //look-up 查询条件 会员
        Select2Ex.handleForm4select2({target:$("#form_data_table_commission_log_cur_user_list_1")});

        TableAjax.init('data_table_commission_log_cur_user_list_1',{
            sAjaxSource: "commission_log/cur_user_list",
            aaSorting: [ [0, "asc" ] ], // 需要自定义
            uxDataTitle:"null",
            uxCheckable:false,
            uxCloseScroll:true,
            uxDrapable:false,
            aoColumns: [
                {sTitle:'层级',  mData: "gradeType",
                    mRender:function(data,d,all){
                        if (all.gradeType==1){
                            return "<font color='green'>直推</font>";
                        }else if (all.gradeType==2){
                            return "<font color='#db7093'>间推</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'付款（元）',  mData: "totalAmount",
                    mRender:function (all,d,all) {
                        return (all.totalAmount/100).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
                    }
                },
                {sTitle:'佣金（元）',  mData: "commissioin",
                    mRender:function (all,d,all) {
                        return (all.commissioin/100).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
                    }
                },
                {sTitle:'支付状态',  mData: "payStatus",
                    mRender:function(data,d,all){
                        if (all.payStatus==0){
                            return "<font color='red'>未支付</font>";
                        }else if (all.payStatus==1){
                            return "<font color='green'>已支付</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'创建时间',  mData: "logTime",
                    mRender:function (all,d,all) {
                        return all.logTimeStr;
                    }
                },
                {sTitle:'付款用户',  mData: "sourceUser.userName"},
                {sTitle:'付款用户昵称',  mData: "sourceUser.nickName"}
            ],
            fnDrawCallback: function(settings) {
                var jq_xhr = settings.jqXHR,
                    response_json = jq_xhr.responseJSON,
                    js_total_space = $("#js-total-space"),
                    total_space = response_json.totalSpace;
                if (total_space) {
                    js_total_space.html(total_space).show();
                } else {
                    js_total_space.hide().html("");
                }
            }

        });

    });

</script>